<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>欢迎使用TPO在线测试管理系统</title>
    
    <script src="${ctx}/js/jquery/jquery-1.10.2.min.js" type="text/javascript"></script> 
    <script src="${ctx}/js/CM.js" type="text/javascript"></script>
    
    <style type="text/css">
	    body, div, ul, li{
		margin:0;
		padding:0;
		}
		html{height:100%; overflow:hidden;}
		body{
			font-family:"微软雅黑", Arial, Helvetica, sans-serif;
			color:#333333;
			line-height:25px;
			font-size:13px;
			height:100%;
		}
		a:link, a:visited {
			text-decoration:none;
			color:#333333;
		}
		a:hover {
			text-decoration: underline;
			color:#08A5E0;
			text-decoration:none;
		}
		
		ul, ul li {
			list-style-type:none;
		}
		.cl {
			zoom:1;
		}
		
		/*网站头部*/
		.col960 {
			width:960px;
			margin:auto;
		}
		.navbg {
			height:40px;
			width: 100%;
			background: #08A5E0;
			box-shadow: 1px 1px 7px #999;
			position:absolute;
			z-index:99;
			left:0;
		}
		#navul li {
			float: left;
			margin-right: 1px;
			width:90px;
			height:40px;
			position:relative;
			text-align:center;
			line-height:40px;
		}
		#navul li.navhome {
			text-align:left;
			padding:0 0px 0 40px;
			width:60px;
		}
		#navul li a:link, #navul li a:visited {
			color:#FFFFFF;
		}
		#navul li ul {
			display:none;
			position:absolute;
			z-index:10000;
			top:38px;
			left:-1px;
			background:#006D96;
			border:#004E6C 1px solid;
			border-bottom:none;
		}
		#navul li ul li {
			display:block;
			width:98px;
			float:none;
			margin-right:0px;
			height:28px;
			position:relative;
			line-height:28px;
			border-bottom:#004E6C 1px solid;
			font-size:12px;
		}
		#navul li.navmoon {
			background:#006D96;
			border:#004E6C 1px solid;
			width:98px;
			height:38px;
			line-height:38px;
		}
		#navul li.navmoon a {
			color:#FFFFFF;
		}
		#navul li.navhome a:hover {
			color:#FCFF00;
		}
		#navul li.navmoon ul {
			display:block;
		}
		#navul li.navmoon ul a {
			display:block;
			width:98px;
			height:28px;
			line-height:28px;
		}
		#navul li.navmoon ul a:hover {
			background:#000000;
		}
		#header ,#centers ,#footer{ width:100%; margin:0 auto; clear:both;} 
		#header{ height:40px;  } 
		#headerinfo{ border-bottom:1px solid #CCCCCC; background:#F2F2F2;} 
		#centers{ padding:8px 0;} 
		#footer{ border-bottom:1px solid #CCCCCC; background:#F2F2F2;} 

	</style>
	
  
    
  </head>
<body>
<div id="header">
		<div class="navbg">
         <div >
		    <ul id="navul" class="cl">
		    </ul>
		  </div>
		</div>
</div> 
<div id="headerinfo" style="margin-bottom: 2px">
<table width="100%" id="Table64" border="0" cellSpacing="0" cellPadding="0">
         <tbody>
          <tr width="50%">
           <td style="padding-left: 3px; font-family: 宋体;">
           
            <img width="16" height="16" align="absMiddle" src="${ctx}/image/place.gif" hspace="3" /> 
            <span id="system_headmenu3" style="width: 80px; color: #666666; font-size: 9pt;"> 欢迎您！</span>
            <span id="system_headmenu1" style="width: 60px; color: #666666; font-size: 9pt;"></span>
            <span id="system_headmenu2" style="width: 150px; color: #666666; font-size: 9pt;"></span>
           </td>
           <td align="right">
           <a href="javascript:void(0);" onclick="f_changepassword();" style="width: 500px; color: #666666; font-size: 9pt;">修改密码</a>
           <a href="userController/loginout.do" style="width: 500px; color: #666666; font-size: 9pt;">退出</a>
           </td>
           <td align="center" width="20">
           </td>
          </tr>
         </tbody>
        </table>
</div>
 <!-- <table width="100%"  border="0" cellpadding="0" cellspacing="0" >
			<tr>
				<td
					style="color: #666666; font-size: 18x; line-height: 24px; padding-left: 28px;">
					系统名称：在线考试管理系统
					<br>
					版本：V1.0
					<br>
					使用单位：小站教育
					<br>
					设计单位：小站教育技术部
					<br>
					系统开发：小站教育技术部
					<br>
					<br>
				</td>
			</tr>
		</table> -->
<iframe id="mainFrame" name="mainFrame" width="100%" frameborder="0" scrolling="auto" style="width:100%;"></iframe>
<script>
		function resizeFrame() {
			document.getElementById("mainFrame").style.height = document.body.offsetHeight-65+"px";
		}
		$(window).load(function() {
			resizeFrame();
		});
		$(window).resize(function() {
			resizeFrame();
		});
		$(document).ready(function () {
		
			$("#system_headmenu3").html(" 欢迎您! ");
			$("#system_headmenu2").html("您当前所在的位置:主页");
			
			$.getJSON('userController/showmenus.do', function (menus) {
				var mainmenu = $("#navul");
				$(menus).each(function (i, menu)
		        {
		            //alert(menu.text);
		            var item = $('<li><a href="javascript:void(0)" title="'+menu.text+'">'+menu.text+'</a><ul></ul></li>');
		            if(menu.menuurl!=""&&menu.menuurl!=undefined){
		            	var tmpurl = "'"+menu.menuurl+"'";
		                var tmptext = "'"+menu.text+"'";
		                var tmpparenttext = "''";
		            	item = $('<li><a href="javascript:f_openMenuurl('+tmpurl+','+tmptext+','+tmpparenttext+')" title="'+menu.text+'">'+menu.text+'</a><ul></ul></li>');
		                } 
		            $(menu.children).each(function (j, submenu)
		            {
		                var tmpurl = "'"+submenu.menuurl+"'";
		                var tmptext = "'"+submenu.text+"'";
		                var tmpparenttext = "'"+menu.text+"'";
		                var subitem = $('<li><a title="'+submenu.text+'" href="javascript:f_openMenuurl('+tmpurl+','+tmptext+','+tmpparenttext+')">'+submenu.text+'</a></li>');
		                $("ul:first", item).append(subitem);
		            });
		            mainmenu.append(item);
		        });
				$("#navul > li").not(".navhome").hover(function(){$(this).addClass("navmoon")},function(){$(this).removeClass("navmoon")})
		    });
			
		});
		</script>
		<script  type="text/javascript"> 
			function f_openMenuurl(menuurl,menutext,parentmenutext){
				var mainWorkArea=document.getElementById("mainFrame");
				mainWorkArea.src=menuurl;
				$("#system_headmenu2").html("您当前所在的位置:"+parentmenutext+" >> "+menutext);
			}
			/* function f_openMainMenuurl(){
				var mainWorkArea=document.getElementById("mainFrame");
				window.location.href='${ctx}/userController/SelectIndex.do';
			}
			 */
			/* 修改密码 */
			function f_changepassword() {
		       	var tmpurl = "${ctx}/userController/ChangePasswordPage.do?name='admin'";
		    	var retvalue = window.showModalDialog(tmpurl,window,"dialogWidth=600px;dialogHeight=350px;resizable=yes;scroll=yes;");
		    	if(retvalue!=null){
		    	}
			}
		
			//iframe高度自适应
			function IFrameReSize(iframename) {
				var pTar = document.getElementById(iframename);
				if (pTar) { //ff
					if(GetBrowserType()=="ie") {
						pTar.height = window.screen.availHeight-window.screenTop-150;
					} else if(GetBrowserType()=="firefox") {
						pTar.height = window.screen.availHeight-window.screenTop-180;
					} else {
						pTar.height = window.screen.availHeight-window.screenTop-180;
					}
				}
			}
		
			function adjustFrameSize()
			{
			    var mainWorkArea=document.getElementById("mainFrame");
			    if(GetBrowserType()=="ie") {
			        mainWorkArea.style.height = mainWorkArea.contentWindow.document.body.scrollHeight<400?400:mainWorkArea.contentWindow.document.body.scrollHeight+50;
				}
			    else if(GetBrowserType()=="firefox") {
			        mainWorkArea.style.height = mainWorkArea.contentWindow.document.documentElement.scrollHeight<400?400:mainWorkArea.contentWindow.document.documentElement.scrollHeight;
			    }
			    else
			    {
			        var contentHeight = 0;
			        var bodyChildNodes = mainWorkArea.contentWindow.document.body.childNodes;
			        for(var i=0 ; i<bodyChildNodes.length; i++)
			        {
			            if(bodyChildNodes[i].nodeType==1)
			            {
			                contentHeight += bodyChildNodes[i].scrollHeight;
			            }
			        }
			        mainWorkArea.style.height = contentHeight<300?400:(contentHeight+120+'px');
			    }
				mainWorkArea.contentWindow.document.body.style.overflowX='auto';
				mainWorkArea.contentWindow.document.body.style.overflowY='auto';
			    
			}
			function GetBrowserType()
			{
			   if(navigator.userAgent.toLowerCase().indexOf("msie")>0)return "ie";//IE
			   if(navigator.userAgent.toLowerCase().indexOf("firefox")>0)return "firefox";//Firefox
			   if(navigator.userAgent.toLowerCase().indexOf("chrome")>0)return "chrome";//Chrome
			   if(navigator.userAgent.toLowerCase().indexOf("safari")>0)return "safari";//Safari
			   return "other";
			}
</script>
 
</body>
</html>

